﻿using UnityEngine;
using System.Collections;

public class EndgameScript : MonoBehaviour {

	private GameObject counter;
	public GUIText text;
	private int points = -1;

	// Use this for initialization
	void Start () {
		counter = GameObject.FindGameObjectWithTag ("PointCounter");
		PointScript script = (PointScript)counter.GetComponent ("PointScript");
		if (points == -1) {
			points = script.getCurrentPoints();
			script.resetPoints();
		}
		Destroy (counter);
		text.text = "Points: " + points;
	}
}
